package org.hive.testserver.service;

import org.hive.testserver.service.repository.HiveRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ApplicationSpringConfig {

	  @Bean
	  public HiveRepository hiveRepository() {
	    return new HiveRepository();
	  }
	  
//	  public @Bean DataSource dataSource() {
//        DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource(url(), username(), password());
//        driverManagerDataSource.setDriverClassName(driverClassname());
//		return driverManagerDataSource;
//	  }
//	  
//	  public @Bean AnnotationSessionFactoryBean sessionFactory() {
//		  AnnotationSessionFactoryBean factoryBean = new AnnotationSessionFactoryBean();
//		  factoryBean.setDataSource(dataSource());
//		  Properties properties = new Properties();
//		  properties.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
//		  properties.setProperty("hibernate.show_sql", "true");
//		  properties.setProperty("hibernate.hbm2ddl.auto", "create");
//		  factoryBean.setHibernateProperties(properties);
//		  
//		  return factoryBean;
//	  }
//	  
//	  String url() {
//		  return "org.hsqldb.jdbcDriver";
//	  }
//	  
//	  String username() {
//		  return "sa";
//	  }
//	  
//	  String password() {
//		  return "";
//	  }
//	  
//	  String driverClassname() {
//		  return "org.hsqldb.jdbcDriver";
//	  }
}
